using System;
using Microsoft.Practices.ServiceLocation;

namespace Caramel
{
	public static class SystemTime
	{
		public static Func<DateTime> GetCurrent = () => { try { return ServiceLocator.Current.GetInstance<ISystemTime>().Now; } catch { return DateTime.Now; } };

		public static DateTime Today { get { return SystemTime.GetCurrent().Date; } }

		public static DateTime Now { get { return SystemTime.GetCurrent(); } }

		public static DateTime UtcNow { get { return SystemTime.GetCurrent().ToUniversalTime(); } }
	}
}
